import http from './http'

import qs from 'qs'
const warehouseConfig = {
    transformRequest: [
        function (data) {
            return qs.stringify(data);
        }
    ],
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
    }
};

const warehouseUpdateConfig = {
    headers: {
        'Content-Type': 'application/json',
    }
};
export const getAllWareHouses = params => http('get', '/api/getAllWareHouses', params)

export const deleteWarehouse = params => http('delete', '/api/deleteWarehouse', params)
export const saveNewWarehouse = params => http('post', '/api/saveNewWarehouse', params, warehouseConfig)

export const updateOneWarehouse = params => http('post', '/api/updateOneWarehouse', params, warehouseUpdateConfig)